package controller;
import project_package.*;
import ui.LoginMenu;

public class StatsController {

	private static StatsController instance = null;
	private ProductRecords productRecordsCtrl;
	private RentHistory rentHistoryCtrl;
	private RentRecords rentRecordsCtrl;
	private SalesRecords salesRecordsCtrl;
	
	public static StatsController getInstance()
    {
    	if(instance == null)
    	{
    		instance = new StatsController();
    	}
    	return instance;
    }
	
	public StatsController()
	{
		salesRecordsCtrl = SalesRecords.getInstance();
		rentRecordsCtrl = RentRecords.getInstance();
		productRecordsCtrl = ProductRecords.getInstance();
		rentHistoryCtrl = RentHistory.getInstance();
	}
	
	public double getTotalSalesPrice()
	{
		double totalSales = salesRecordsCtrl.getTotalSalesPrice();
		return totalSales;
	}
	
	public int getTotalSalesNumber()
	{
		int totalSales = salesRecordsCtrl.getTotalSalesNumber();
		return totalSales;
	}
	
	public void printAllSales()
	{
		salesRecordsCtrl.printSalesRecords();
	}
	
	public double getTotalRentsPrice()
	{
		double back = rentHistoryCtrl.getTotalRentPrice();
		return back;
	}
	
	public int getTotalRentsNumber()
	{
		int back = rentHistoryCtrl.getTotalRentNumber();
		return back;
	}
	
	public void printAllRents()
	{
		rentHistoryCtrl.printAllRents();
	}
	
	public boolean checkIfRentsEx()
	{
		return rentRecordsCtrl.checkIfNoRents();
	}
	public String printUnavableRentID()
	{
		String back = rentRecordsCtrl.printUnavabRentID();
		return back;
	}
	public String printAvableRentID()
	{
		String back = rentRecordsCtrl.printAvabRentID();
		return back;
	}
	public String printUnavableRentName()
	{
		String back = rentRecordsCtrl.printUnavabRentName();
		return back;
	}
	public String printAvableRentName()
	{
		String back = rentRecordsCtrl.printAvabRentName();
		return back;
	}
	public String printUnavableRentPrice()
	{
		String back = rentRecordsCtrl.printUnavabRentPrice();
		return back;
	}
	public String printAvableRentPrice()
	{
		String back = rentRecordsCtrl.printAvabRentPrice();
		return back;
	}
	public String printCustomerDateRent()
	{
		String back = rentRecordsCtrl.printCustDateRent();
		return back;
	}
	public String printCustomerDurationRent()
	{
		String back = rentRecordsCtrl.printCustDurationRent();
		return back;
	}
	public String printCustomerSetReturn()
	{
		String back = rentRecordsCtrl.printCustSetReturn();
		return back;
	}
	
	
		
	//	public double getTotalProductsPrice()
	//	{
	//		double back = productRecordsCtrl.
	//	}
		
	public int getTotalProductsNumber()
	{
		int back = productRecordsCtrl.getTotalProducts();
		return back;
	}
	
	public void printAllProducts()
	{
		productRecordsCtrl.printProducts();
	}
}